package com.cdtye.shuoh.domain.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cdtye.common.mybatiscore.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 产品模型
 * @author ZhongWang Wang
 * @date 2022-12-21
 */
@ApiModel("产品模型")
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("IOT_PRODUCT")
public class Product extends BaseEntity {
    
    @ApiModelProperty(value = "两种产品类型：0：普通产品，需直连设备 1：网关产品，可挂载子设备")
    private String productType;

    @ApiModelProperty(value = "产品名称:自定义，支持中文、英文大小写、数字、下划线和中划线")
    private String productName;

    @ApiModelProperty(value = "厂商ID:支持英文大小写，数字，下划线和中划线")
    private String manufacturerId;

    @ApiModelProperty(value = "厂商名称 :支持中文、英文大小写、数字、下划线和中划线")
    private String manufacturerName;

    @ApiModelProperty(value = "产品型号")
    private String model;

    @ApiModelProperty(value="状态 1启用, 0禁用")
    private String state;

    @ApiModelProperty(value="状态名称 1启用, 0禁用")
    @TableField(exist = false)
    private String stateName;

    @ApiModelProperty(value = "数据格式，默认为JSON无需修改")
    private String dataFormat;

    @ApiModelProperty(value="设备类型")
    private String deviceType;

    @ApiModelProperty(value = "设备接入平台的协议类型，默认为MQTT无需修改")
    private String protocolType;

    @ApiModelProperty(value = "产品描述")
    private String remark;

    @ApiModelProperty(value = "逻辑删除")
    private String delFlag;

    @ApiModelProperty(value = "产品标识")
    private String productIdentification;

//    @ApiModelProperty(value = "产品序列号")
//    private String productSerial;

    public String getStateName(){
        if("1".equals(state)){
            return "启用";
        }
        return "禁用";
    }



}